:root {
  --coral: #ffd1dc;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
}

.app {
  min-height: 100vh;
  min-width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--coral);
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 20px;
  padding: 20px;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.pencil-holder {
  margin-top: -70px;
  background-color: var(--white);
  border-radius: 25px;
  padding: 25px;
  cursor: pointer;
  position: relative;
  transition: all 0.4s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15),
    inset 0 2px 6px rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(0, 0, 0, 0.1);
  background-image: radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.8) 0%,
      transparent 75%
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%),
    linear-gradient(225deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%);
  background-size: 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
  background-position: center top, 0 0, 0 0, 0 0, 0 0;
  border: 3px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transform-style: preserve-3d;
  perspective: 1000px;
  width: 200px;
}

.pencil-holder::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, var(--coral), rgba(255, 127, 127, 0.6));
  border-radius: 25px;
  z-index: -1;
  filter: blur(8px);
  opacity: 0.6;
}

.pencil-holder::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, var(--coral), rgba(255, 127, 127, 0.6));
  border-radius: 25px;
  z-index: -1;
  filter: blur(8px);
  opacity: 0.6;
}

.pencil-holder:hover {
  transform: translateY(-5px);
}

.pencil-holder:active {
  animation: shake 0.5s ease-in-out;
}

.hand-icon {
  font-size: 2rem;
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
}

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 200px;
  min-width: 150px;
  position: relative;
}

.stacked-card {
  background-color: var(--white);
  height: 30px;
  border-radius: 8px;
  position: absolute;
  width: 100%;
  box-shadow: 0 1px 3px var(--shadow);
  transform: translateY(calc(var(--index) * 2px))
    rotate(calc(var(--rotation) * 1deg));
}

.stacked-card:nth-child(1) {
  --index: 0;
  --rotation: -2;
}
.stacked-card:nth-child(2) {
  --index: 1;
  --rotation: -1;
}
.stacked-card:nth-child(3) {
  --index: 2;
  --rotation: 0;
}
.stacked-card:nth-child(4) {
  --index: 3;
  --rotation: 1;
}
.stacked-card:nth-child(5) {
  --index: 4;
  --rotation: 2;
}

.card-display {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.card {
  background-color: var(--white);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
  text-align: center;
  font-size: 1.2rem;
  max-width: 250px;
  width: 100%;
  word-wrap: break-word;
  white-space: normal;
  animation: dropIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px) rotateX(5deg);
}

@keyframes dropIn {
  0% {
    opacity: 0;
    transform: translateY(-200px) rotate(-15deg) scale(0.8);
  }
  40% {
    transform: translateY(20px) rotate(10deg) scale(1.1);
  }
  60% {
    transform: translateY(10px) rotate(-5deg) scale(0.95);
  }
  80% {
    transform: translateY(5px) rotate(2deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes shake {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(-8deg) translateY(-2px);
  }
  50% {
    transform: rotate(0deg) translateY(0);
  }
  75% {
    transform: rotate(8deg) translateY(-2px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(-50%);
  }
  50% {
    transform: translateY(-10px) translateX(-50%);
  }
  100% {
    transform: translateY(0) translateX(-50%);
  }
}

.animate-float {
  animation: float 2s ease-in-out infinite;
}

.decorative-icons {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
}

.icon-float {
  animation: iconFloat 2s ease-in-out infinite;
  opacity: 0.8;
  font-size: 1.2rem;
}

.delay-1 {
  animation-delay: 0.5s;
}

.delay-2 {
  animation-delay: 1s;
}

.delay-3 {
  animation-delay: 1.5s;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.guide-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  color: var(--coral);
  background-color: var(--white);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 1rem;
  box-shadow: 0 4px 8px var(--shadow);
  animation: fadeIn 0.5s ease-out;
  z-index: 1;
}
